function buildPager(page,totalPage,startPage,endPage){ 
	if(/[^0-9-]+/.test(page))
	{
		page = 1;
	}
	if(page == 0)
	{
		page = 1;
	}
	if(page > endPage)
	{
		page = endPage;
	}
	var pagerContent = '<div class="page_list clearfix">';
	if(page==1){
		pagerContent += '<a href="javascript:void(0)" title="上一页" class="next_page disabled_page"><i>上一页</i></a>';
	}else{
		pagerContent += '<a href="javascript:void(0)" title="上一页" onclick="return changePage('+(page-1)+')" class="prev_page "><i>上一页</i></a>';
	}

	if(page>=4){
		if(page!=4){
			pagerContent += '<a href="javascript:void(0)" title="第1页"  onclick="return changePage(1)"><i>1</i></a>';
		}
		if(page>=5){
    		pagerContent += '<span class="page_more">...</span>';
		}
	}

    for(i = startPage; i<=endPage; i++){
    	pagerContent += '<a href="javascript:void(0)" title="第'+i+'页" onclick="return changePage('+i+')" ';
    	if (page == i){
    		pagerContent += ' class="curr_page" ';
    	}
    	pagerContent += '><i>'+i+'</i></a>';
    } 

    if(page<=totalPage-3){
		if(page<=totalPage-4){
    		pagerContent += '<span class="page_more">...</span>';
		}
		
		if (endPage != totalPage){
			pagerContent += '<a href="javascript:void(0)" title="第'+totalPage+'页" onclick="return changePage('+totalPage+')"><i>' + totalPage + '</i></a>';
		}
	}

    if(page==totalPage || totalPage == 0){
		pagerContent += '<a href="javascript:void(0)" title="下一页" class="next_page disabled_page"><i>下一页</i></a>';
	}else{
		pagerContent += '<a href="javascript:void(0)" title="下一页" class="next_page" onclick="return changePage('+(page+1)+')"><i>下一页</i></a>';
	}
    pagerContent += '</div>';
    
	return pagerContent;
}

function buildOtherPager(page,totalPage,startPage,endPage,category){ 
	if(/[^0-9-]+/.test(page))
	{
		page = 1;
	}
	if(page == 0)
	{
		page = 1;
	}
	if(page > endPage)
	{
		page = endPage;
	}
	var pagerContent = '<div class="page_list clearfix">';
	if(page==1){
		pagerContent += '<a href="javascript:void(0)" title="上一页" class="next_page disabled_page"><i>上一页</i></a>';
	}else{
		pagerContent += '<a href="javascript:void(0)" title="上一页" onclick="return changePage('+(page-1)+','+category+',this)" class="prev_page "><i>上一页</i></a>';
	}
	if(totalPage != 5){
		if(page>=4){
			if(page!=4){
				pagerContent += '<a href="javascript:void(0)" title="第1页"  onclick="return changePage(1,'+category+',this)"><i>1</i></a>';
			}
			if(page>=5){
				pagerContent += '<span class="page_more">...</span>';
			}
		}
	}

    for(i = startPage; i<=endPage; i++){
    	pagerContent += '<a href="javascript:void(0)" title="第'+i+'页" onclick="return changePage('+i+','+category+',this)" ';
    	if (page == i){
    		pagerContent += ' class="curr_page" ';
    	}
    	pagerContent += '><i>'+i+'</i></a>';
    } 
    
    if(totalPage != 5){
	    if(page<=totalPage-3){
			if(page<=totalPage-4){
	    		pagerContent += '<span class="page_more">...</span>';
			}
			
			if (endPage != totalPage){
				pagerContent += '<a href="javascript:void(0)" title="第'+totalPage+'页" onclick="return changePage('+totalPage+','+category+',this)"><i>' + totalPage + '</i></a>';
			}
		}
    }

    if(page==totalPage || totalPage == 0){
		pagerContent += '<a href="javascript:void(0)" title="下一页" class="next_page disabled_page"><i>下一页</i></a>';
	}else{
		pagerContent += '<a href="javascript:void(0)" title="下一页" class="next_page" onclick="return changePage('+(page+1)+','+category+',this)"><i>下一页</i></a>';
	}
    pagerContent += '</div>';
    
	return pagerContent;
}

function buildSpecialPager(page,totalPage,startPage,endPage,category){ 
	if(/[^0-9-]+/.test(page))
	{
		page = 1;
	}
	if(page == 0)
	{
		page = 1;
	}
	if(page > endPage)
	{
		page = endPage;
	}
	var pagerContent = '<div class="list">';
	if(page==1){
		pagerContent += '<a href="javascript:void(0)" title="上一页" class="prev disabled_page"><span>上一页</span></a>';
	}else{
		pagerContent += '<a href="javascript:void(0)" title="上一页" onclick="return changePage('+(page-1)+','+category+',this)" class="prev "><span>上一页</span></a>';
	}
	if(totalPage != 5){
		if(page>=4){
			if(page!=4){
				pagerContent += '<a href="javascript:void(0)" title="第1页"  onclick="return changePage(1,'+category+',this)"><span>1</span></a>';
			}
			if(page>=5){
				pagerContent += '<span class="more"><span>...</span></span>';
			}
		}
	}

    for(i = startPage; i<=endPage; i++){
    	pagerContent += '<a href="javascript:void(0)" title="第'+i+'页" onclick="return changePage('+i+','+category+',this)" ';
    	if (page == i){
    		pagerContent += ' class="curr" ';
    	}
    	pagerContent += '><span>'+i+'</span></a>';
    } 
    
    if(totalPage != 5){
	    if(page<=totalPage-3){
			if(page<=totalPage-4){
	    		pagerContent += '<span class="more"><span>...</span></span>';
			}
			
			if (endPage != totalPage){
				pagerContent += '<a href="javascript:void(0)" title="第'+totalPage+'页" onclick="return changePage('+totalPage+','+category+',this)"><span>' + totalPage + '</span></a>';
			}
		}
    }

    if(page==totalPage || totalPage == 0){
		pagerContent += '<a href="javascript:void(0)" title="下一页" class="next disabled_page"><span>下一页</span></a>';
	}else{
		pagerContent += '<a href="javascript:void(0)" title="下一页" class="next" onclick="return changePage('+(page+1)+','+category+',this)"><span>下一页</span></a>';
	}
    pagerContent += '</div>';
    
	return pagerContent;
}